<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <title>测试</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>


  <script>
    var editor, editor2
    var API_DATA = {
      method: 'POST',
      url: '',
      baseUrl: '/',
      data: {}
    }
    $(function () {
      editor = ace.edit("editor");
      editor.setTheme("ace/theme/monokai");
      editor.session.setMode("ace/mode/javascript");
      editor.getSession().setTabSize(2);
      editor.setReadOnly(true);
      var str = '{{json}}';
      var div = document.createElement('div')
      div.innerHTML = str;
      str = div.innerHTML
      str = JSON.parse(str);
      editor.setValue(JSON.stringify(str, null, 2));
    })

  </script>
  <style>
    body,html{
      width:100%;height:100%;margin:0;padding:0;
    }
    #editor { 
        width:100%;height:100%;font-size: 18px;
    }
  </style>
</head>

<body>
  <div id="editor"></div>
  <script src="/static/js/ace-builds-master/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
</body>

</html>